import { SelectOption } from 'naive-ui'

const list: SelectOption[] = [
  {
    label: '手机号',
    value: 'isPhone'
  },
  {
    label: '固定电话',
    value: 'isTel'
  },
  {
    label: '邮箱',
    value: 'isEmail'
  },
  {
    label: '外链',
    value: 'isExternal'
  },
  {
    label: '传统网站',
    value: 'isUrl'
  },
  {
    label: '为空',
    value: 'isBlank'
  },
  {
    label: '身份证号(第二代)',
    value: 'isIdCard'
  },
  {
    label: '纯数字',
    value: 'isNumber'
  },
  {
    label: '数字且最多两位小数',
    value: 'isNum'
  },
  {
    label: '中文',
    value: 'isChina'
  },
  {
    label: '小写字母',
    value: 'isLowerCase'
  },
  {
    label: '大写字母',
    value: 'isUpperCase'
  },
  {
    label: '大写字母开头',
    value: 'isAlphabets'
  },
  {
    label: '字符串',
    value: 'isString'
  },
  {
    label: '数组',
    value: 'isArray'
  },
  {
    label: 'json',
    value: 'isJson'
  },
  {
    label: 'IP',
    value: 'isIP'
  },
  {
    label: '端口号',
    value: 'isPort'
  }
]

export default list

export function getValidateLabel(value: string) {
  const info = list.find((el: SelectOption) => el.value === value)
  return info?.label || value
}
